/**
 * Created by ZFL on 2017/9/28.
 */
function appInit() {
    PageInit();
}
function PageInit () {
}

//重新支付
function pay() {
    window.location.href = '/b2c/pay/order_pay.html?orderSn='+$.getPara("orderSn")+'';
}

//取消订单
function cancelOrder() {
    $.ajaxHandler({
        model: function () {
            var obj = {};
            obj.orderObjectId = 0;
            obj.orderSn = $.getPara("orderSn");
            obj.userId = com_obj.userId;
            return obj;
        },
        visibleTime: 0,
        dataType: "json",
        approve: true,
        api: "yg_baijiaapporder/order/cancelOrder",
        success: function (result) {
            console.log(result);
            if (result.code == 10000) {
                YDUI.dialog.toast('取消订单成功', 'success', 800,function(){
                    window.location.href = '/b2c/order/order.html'
                });
            }else {
                YDUI.dialog.toast(result.message, 'error', 800);
            }
        }
    });
}

